package com.wbihua.common.metrics.type;

import lombok.Getter;

@Getter
public enum EventCounterType {
    //按照惯例，Counter 类型的指标通常以_total 为后缀
    //转变成prometheus指标名称为http_requests_total，如果指标名称最后没有total就自动增加一个total
    REQUEST_TOTAL("http.requests"),
    //tag_http_requests_total_request_total是由name+baseUnit+total
    TAG_REQUEST_TOTAL("tag.http.requests.total", new String[]{"path", "method", "code"}, "request","Total requests."),
    //转变成prometheus指标名称为prometheus_http_requests_total，如果指标名称最后没有total就自动增加一个total
    PROMETHEUS_REQUEST_TOTAL("prometheus_http_requests", new String[]{"path", "method", "code"}, "Total requests.");
    private final String name;
    private String[] tags = new String[]{};
    private String description;
    private String baseUnit;
    private String[] labelNames = new String[]{};
    private String help;
    EventCounterType(String name) {
        this.name = name;
    }

    EventCounterType(String name, String[] tags, String baseUnit, String description) {
        this.name = name;
        this.tags = tags;
        this.baseUnit = baseUnit;
        this.description = description;
    }

    EventCounterType(String name, String[] labelNames, String help) {
        this.name = name;
        this.labelNames = labelNames;
        this.help = help;
    }
}
